﻿/*   
    Copyright (C) 2009 Galaktika Corporation ZAO

    This file is a part of Galaktika.BusinessMonitor
 
    Galaktika.BusinessMonitor is a free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
      
    You should have received a copy of the GNU General Public License
    along with Galaktika.BusinessMonitor.  If not, see <http://www.gnu.org/licenses/>.
  
    If GPL v.3 is not suitable for your products or company,
    Galaktika Corp provides Galaktika.BusinessMonitor under a flexible commercial license
    designed to meet your specific usage and distribution requirements.
    If you have already obtained a commercial license from Galaktika Corp,
    you can use this file under those license terms.
*/

namespace Galaktika.BI.Silverlight.Services.PivotGridService
{
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    [System.ServiceModel.ServiceContractAttribute(Namespace = "http://www.galaktika.by/bi/3.0/", ConfigurationName = "PivotGridService.PivotGridServiceSoap")]
    public interface PivotGridServiceSoap
    {

        [System.ServiceModel.OperationContractAttribute(AsyncPattern = true, Action = "http://www.galaktika.by/bi/3.0/SetExportParameters", ReplyAction = "*")]
        System.IAsyncResult BeginSetExportParameters(Galaktika.BI.Silverlight.Services.PivotGridService.SetExportParametersRequest request, System.AsyncCallback callback, object asyncState);

        Galaktika.BI.Silverlight.Services.PivotGridService.SetExportParametersResponse EndSetExportParameters(System.IAsyncResult result);
    }

    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    [System.ServiceModel.MessageContractAttribute(IsWrapped = false)]
    public partial class SetExportParametersRequest
    {

        [System.ServiceModel.MessageBodyMemberAttribute(Name = "SetExportParameters", Namespace = "http://www.galaktika.by/bi/3.0/", Order = 0)]
        public Galaktika.BI.Silverlight.Services.PivotGridService.SetExportParametersRequestBody Body;

        public SetExportParametersRequest()
        {
        }

        public SetExportParametersRequest(Galaktika.BI.Silverlight.Services.PivotGridService.SetExportParametersRequestBody Body)
        {
            this.Body = Body;
        }
    }

    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Namespace = "http://www.galaktika.by/bi/3.0/")]
    public partial class SetExportParametersRequestBody
    {

        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue = false, Order = 0)]
        public string token;

        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue = false, Order = 1)]
        public string connectionString;

        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue = false, Order = 2)]
        public string query;

        public SetExportParametersRequestBody()
        {
        }

        public SetExportParametersRequestBody(string token, string connectionString, string query)
        {
            this.token = token;
            this.connectionString = connectionString;
            this.query = query;
        }
    }

    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    [System.ServiceModel.MessageContractAttribute(IsWrapped = false)]
    public partial class SetExportParametersResponse
    {

        [System.ServiceModel.MessageBodyMemberAttribute(Name = "SetExportParametersResponse", Namespace = "http://www.galaktika.by/bi/3.0/", Order = 0)]
        public Galaktika.BI.Silverlight.Services.PivotGridService.SetExportParametersResponseBody Body;

        public SetExportParametersResponse()
        {
        }

        public SetExportParametersResponse(Galaktika.BI.Silverlight.Services.PivotGridService.SetExportParametersResponseBody Body)
        {
            this.Body = Body;
        }
    }

    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Namespace = "http://www.galaktika.by/bi/3.0/")]
    public partial class SetExportParametersResponseBody
    {

        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue = false, Order = 0)]
        public string SetExportParametersResult;

        public SetExportParametersResponseBody()
        {
        }

        public SetExportParametersResponseBody(string SetExportParametersResult)
        {
            this.SetExportParametersResult = SetExportParametersResult;
        }
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    public interface PivotGridServiceSoapChannel : Galaktika.BI.Silverlight.Services.PivotGridService.PivotGridServiceSoap, System.ServiceModel.IClientChannel
    {
    }

    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    public partial class SetExportParametersCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
    {

        private object[] results;

        public SetExportParametersCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
            base(exception, cancelled, userState)
        {
            this.results = results;
        }

        public string Result
        {
            get
            {
                base.RaiseExceptionIfNecessary();
                return ((string)(this.results[0]));
            }
        }
    }

    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    public partial class PivotGridServiceSoapClient : System.ServiceModel.ClientBase<Galaktika.BI.Silverlight.Services.PivotGridService.PivotGridServiceSoap>, Galaktika.BI.Silverlight.Services.PivotGridService.PivotGridServiceSoap
    {

        private BeginOperationDelegate onBeginSetExportParametersDelegate;

        private EndOperationDelegate onEndSetExportParametersDelegate;

        private System.Threading.SendOrPostCallback onSetExportParametersCompletedDelegate;

        private BeginOperationDelegate onBeginOpenDelegate;

        private EndOperationDelegate onEndOpenDelegate;

        private System.Threading.SendOrPostCallback onOpenCompletedDelegate;

        private BeginOperationDelegate onBeginCloseDelegate;

        private EndOperationDelegate onEndCloseDelegate;

        private System.Threading.SendOrPostCallback onCloseCompletedDelegate;

        public PivotGridServiceSoapClient()
        {
        }

        public PivotGridServiceSoapClient(string endpointConfigurationName) :
            base(endpointConfigurationName)
        {
        }

        public PivotGridServiceSoapClient(string endpointConfigurationName, string remoteAddress) :
            base(endpointConfigurationName, remoteAddress)
        {
        }

        public PivotGridServiceSoapClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
            base(endpointConfigurationName, remoteAddress)
        {
        }

        public PivotGridServiceSoapClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
            base(binding, remoteAddress)
        {
        }

        public event System.EventHandler<SetExportParametersCompletedEventArgs> SetExportParametersCompleted;

        public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> OpenCompleted;

        public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> CloseCompleted;

        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        System.IAsyncResult Galaktika.BI.Silverlight.Services.PivotGridService.PivotGridServiceSoap.BeginSetExportParameters(Galaktika.BI.Silverlight.Services.PivotGridService.SetExportParametersRequest request, System.AsyncCallback callback, object asyncState)
        {
            return base.Channel.BeginSetExportParameters(request, callback, asyncState);
        }

        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        private System.IAsyncResult BeginSetExportParameters(string token, string connectionString, string query, System.AsyncCallback callback, object asyncState)
        {
            Galaktika.BI.Silverlight.Services.PivotGridService.SetExportParametersRequest inValue = new Galaktika.BI.Silverlight.Services.PivotGridService.SetExportParametersRequest();
            inValue.Body = new Galaktika.BI.Silverlight.Services.PivotGridService.SetExportParametersRequestBody();
            inValue.Body.token = token;
            inValue.Body.connectionString = connectionString;
            inValue.Body.query = query;
            return ((Galaktika.BI.Silverlight.Services.PivotGridService.PivotGridServiceSoap)(this)).BeginSetExportParameters(inValue, callback, asyncState);
        }

        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        Galaktika.BI.Silverlight.Services.PivotGridService.SetExportParametersResponse Galaktika.BI.Silverlight.Services.PivotGridService.PivotGridServiceSoap.EndSetExportParameters(System.IAsyncResult result)
        {
            return base.Channel.EndSetExportParameters(result);
        }

        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        private string EndSetExportParameters(System.IAsyncResult result)
        {
            Galaktika.BI.Silverlight.Services.PivotGridService.SetExportParametersResponse retVal = ((Galaktika.BI.Silverlight.Services.PivotGridService.PivotGridServiceSoap)(this)).EndSetExportParameters(result);
            return retVal.Body.SetExportParametersResult;
        }

        private System.IAsyncResult OnBeginSetExportParameters(object[] inValues, System.AsyncCallback callback, object asyncState)
        {
            string token = ((string)(inValues[0]));
            string connectionString = ((string)(inValues[1]));
            string query = ((string)(inValues[2]));
            return this.BeginSetExportParameters(token, connectionString, query, callback, asyncState);
        }

        private object[] OnEndSetExportParameters(System.IAsyncResult result)
        {
            string retVal = this.EndSetExportParameters(result);
            return new object[] {
                    retVal};
        }

        private void OnSetExportParametersCompleted(object state)
        {
            if ((this.SetExportParametersCompleted != null))
            {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.SetExportParametersCompleted(this, new SetExportParametersCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }

        public void SetExportParametersAsync(string token, string connectionString, string query)
        {
            this.SetExportParametersAsync(token, connectionString, query, null);
        }

        public void SetExportParametersAsync(string token, string connectionString, string query, object userState)
        {
            if ((this.onBeginSetExportParametersDelegate == null))
            {
                this.onBeginSetExportParametersDelegate = new BeginOperationDelegate(this.OnBeginSetExportParameters);
            }
            if ((this.onEndSetExportParametersDelegate == null))
            {
                this.onEndSetExportParametersDelegate = new EndOperationDelegate(this.OnEndSetExportParameters);
            }
            if ((this.onSetExportParametersCompletedDelegate == null))
            {
                this.onSetExportParametersCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSetExportParametersCompleted);
            }
            base.InvokeAsync(this.onBeginSetExportParametersDelegate, new object[] {
                        token,
                        connectionString,
                        query}, this.onEndSetExportParametersDelegate, this.onSetExportParametersCompletedDelegate, userState);
        }

        private System.IAsyncResult OnBeginOpen(object[] inValues, System.AsyncCallback callback, object asyncState)
        {
            return ((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(callback, asyncState);
        }

        private object[] OnEndOpen(System.IAsyncResult result)
        {
            ((System.ServiceModel.ICommunicationObject)(this)).EndOpen(result);
            return null;
        }

        private void OnOpenCompleted(object state)
        {
            if ((this.OpenCompleted != null))
            {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.OpenCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
            }
        }

        public void OpenAsync()
        {
            this.OpenAsync(null);
        }

        public void OpenAsync(object userState)
        {
            if ((this.onBeginOpenDelegate == null))
            {
                this.onBeginOpenDelegate = new BeginOperationDelegate(this.OnBeginOpen);
            }
            if ((this.onEndOpenDelegate == null))
            {
                this.onEndOpenDelegate = new EndOperationDelegate(this.OnEndOpen);
            }
            if ((this.onOpenCompletedDelegate == null))
            {
                this.onOpenCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnOpenCompleted);
            }
            base.InvokeAsync(this.onBeginOpenDelegate, null, this.onEndOpenDelegate, this.onOpenCompletedDelegate, userState);
        }

        private System.IAsyncResult OnBeginClose(object[] inValues, System.AsyncCallback callback, object asyncState)
        {
            return ((System.ServiceModel.ICommunicationObject)(this)).BeginClose(callback, asyncState);
        }

        private object[] OnEndClose(System.IAsyncResult result)
        {
            ((System.ServiceModel.ICommunicationObject)(this)).EndClose(result);
            return null;
        }

        private void OnCloseCompleted(object state)
        {
            if ((this.CloseCompleted != null))
            {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.CloseCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
            }
        }

        public void CloseAsync()
        {
            this.CloseAsync(null);
        }

        public void CloseAsync(object userState)
        {
            if ((this.onBeginCloseDelegate == null))
            {
                this.onBeginCloseDelegate = new BeginOperationDelegate(this.OnBeginClose);
            }
            if ((this.onEndCloseDelegate == null))
            {
                this.onEndCloseDelegate = new EndOperationDelegate(this.OnEndClose);
            }
            if ((this.onCloseCompletedDelegate == null))
            {
                this.onCloseCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnCloseCompleted);
            }
            base.InvokeAsync(this.onBeginCloseDelegate, null, this.onEndCloseDelegate, this.onCloseCompletedDelegate, userState);
        }

        protected override Galaktika.BI.Silverlight.Services.PivotGridService.PivotGridServiceSoap CreateChannel()
        {
            return new PivotGridServiceSoapClientChannel(this);
        }

        private class PivotGridServiceSoapClientChannel : ChannelBase<Galaktika.BI.Silverlight.Services.PivotGridService.PivotGridServiceSoap>, Galaktika.BI.Silverlight.Services.PivotGridService.PivotGridServiceSoap
        {

            public PivotGridServiceSoapClientChannel(System.ServiceModel.ClientBase<Galaktika.BI.Silverlight.Services.PivotGridService.PivotGridServiceSoap> client) :
                base(client)
            {
            }

            public System.IAsyncResult BeginSetExportParameters(Galaktika.BI.Silverlight.Services.PivotGridService.SetExportParametersRequest request, System.AsyncCallback callback, object asyncState)
            {
                object[] _args = new object[1];
                _args[0] = request;
                System.IAsyncResult _result = base.BeginInvoke("SetExportParameters", _args, callback, asyncState);
                return _result;
            }

            public Galaktika.BI.Silverlight.Services.PivotGridService.SetExportParametersResponse EndSetExportParameters(System.IAsyncResult result)
            {
                object[] _args = new object[0];
                Galaktika.BI.Silverlight.Services.PivotGridService.SetExportParametersResponse _result = ((Galaktika.BI.Silverlight.Services.PivotGridService.SetExportParametersResponse)(base.EndInvoke("SetExportParameters", _args, result)));
                return _result;
            }
        }
    }
}
